package com.platform.base.service.impl;

import java.util.List;
import java.util.Arrays;
import com.platform.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.platform.base.mapper.MeterTypeMapper;
import com.platform.base.domain.MeterType;
import com.platform.base.service.IMeterTypeService;
import com.platform.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 热型号Service业务层处理
 * 
 * @author wangqi
 * @date 2020-09-26
 */
@Service
public class MeterTypeServiceImpl extends ServiceImpl<MeterTypeMapper,MeterType> implements IMeterTypeService
{
    @Autowired
    private MeterTypeMapper meterTypeMapper;

    /**
     * 查询热型号列表
     * 
     * @param meterType 热型号
     * @return 热型号
     */
    @Override
    public List<MeterType> selectMeterTypeList(MeterType meterType)
    {
        return meterTypeMapper.selectMeterTypeList(meterType);
    }

    /**
     * 新增热型号
     * 
     * @param meterType 热型号
     * @return 结果
     */
    @Override
    public int insertMeterType(MeterType meterType)
    {
        meterType.setCreateTime(DateUtils.getNowDate());
        return meterTypeMapper.insert(meterType);
    }

    /**
     * 修改热型号
     * 
     * @param meterType 热型号
     * @return 结果
     */
    @Override
    public int updateMeterType(MeterType meterType)
    {
        meterType.setUpdateTime(DateUtils.getNowDate());
        return meterTypeMapper.updateById(meterType);
    }

    /**
     * 删除热型号对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteMeterTypeByIds(String ids)
    {
        return meterTypeMapper.deleteBatchIds(Arrays.asList(Convert.toStrArray(ids)));
    }

    /**
     * 删除热型号信息
     * 
     * @param typeId 热型号ID
     * @return 结果
     */
    @Override
    public int deleteMeterTypeById(Long typeId)
    {
        return meterTypeMapper.deleteById(typeId);
    }
}
